package com.boot.controller;

import com.boot.domain.CommonResult;
import com.boot.mapper.StorageMapper;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Description:
 *
 * @Autor: Rolin
 * datetime: 05-09-22:01
 */
@RestController
public class StorageController {

    @Resource
    private StorageMapper storageMapper;

    @PostMapping("storage/decrease")
    public CommonResult decrease(@RequestParam("productId")Long productId,
                          @RequestParam("count")Integer count){
        storageMapper.decrease(productId, count);
        return new CommonResult(200,"扣减库存成功！");
    }
}
